package com.bw.entity;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.util.Date;

@Data
public class EmployeeAdd {

    @NotBlank(message = "姓名不为空")
    private String name;

    @NotBlank(message = "工号不为空")
    private String num;

    @NotNull(message = "部门不为空")
    private Integer deptId;

    @NotNull(message = "小组不为空")
    private Integer groupId;

    @NotNull(message = "考勤不为空")
    private Integer kaoqin;

    @NotNull(message = "入职日期不为空")
    @Past(message = "入职日期小于当前时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")  // 这个注解是用来 把String -》 date
    private Date createTime;

}
